/*
* loading
* @param {string} msg 提示内容
* */
import { Loading } from "@opentiny/vue";
import { createVNode } from 'vue';
import { LOADING_CONFIG } from '../../config/public';
let loading = null;
export const CDLoading = {
    //加载中
    loading: (msg) => {
        if(loading){
            return;
        }
        loading = Loading.service({
          lock: true,
          text: "Loading",
          size: LOADING_CONFIG.size,
          lock: true,
          background: LOADING_CONFIG.background,
        });

    },
    //关闭加载中
    close: () => {
        //延时关闭
        setTimeout(() => {
            if(loading){
                loading.close();
                loading = null;
            }
        }, LOADING_CONFIG.delay);
    }
}